<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<#include "/admin/include/head.htm">
<script type="text/javascript" src="${base}/resource/js/menu.js"></script>
<script type="text/javascript" src="${base}/resource/js/iconselector.js"></script>
<script type="text/javascript">
	$(function(){
		$("#oIcon").click(function(){
			currentComboBox = this;
            f_openIconsWin();
		});
	});
	
	function doSubmit(){
		LG.submitForm(null, function(data){
			window.parent.leftFrame.addNode(data, false);
			LG.showSuccess("添加菜单成功!");
			$("form").clearForm();
		});
	}
</script>
</head>
<body>
<div class="body-box">
<form action="add.jhtml" method="post" class="validate" id="mainform">
	<table class="inputTable2">
		<tr>
			<th>父菜单：</th>
	        <td>
				${(parentMenu.name)!''}
				<#if parentMenu.id??>
	            <input type="hidden" name="upDomain.id" value="${(parentMenu.id)!''}"/>
				</#if>
	        </td>
		</tr>
	    <tr id="_menuName" style="display: none;">
	    	<th>菜单名：</th>
	        <td><input name="name" class="formText {required: true}"/></td>
		</tr>
		<tr id="_menuNo">
	    	<th>菜单编号：</th>
	        <td><input name="menuNo" class="formText {required: true,  maxlength:200, remote:'${base}/admin/system/menu/checkMenuNo.jhtml', messages: {remote: '菜单编号!'}}"/></td>
		</tr>
		<tr>
	        <th>菜单类型：</th>
	        <td><@u.select_map headerKey="" headerValue="" onchange="showHideActionRow(this);"
					headerButtom="false" list=menuTypes name="type" id="menuType"/>
	        </td>
		</tr>
		<tr id="menuUrl" style="display:none">
	        <th>操作URL：</th>
	        <td><input name="operate.url" class="formText" style="width:300px;"/></td>
	    </tr>
		<tr id="menuPattern" style="display:none">
		  	<th>URL规则：</th>
			<td>
				<textarea name="operate.pattern" class="text" style="width:350px;height:80px"></textarea>
			</td>
	    </tr>
		<tr id="menuHtml" style="display:none">
		  	<th>HTML：</th>
			<td>
				<textarea name="operate.html" class="text" style="width:350px;height:80px"></textarea>
			</td>
	    </tr>
	    <#--
		<tr id="menuCode" style="display:none">
		  	<th>模块图标：</th>
			<td>
				<input name="operate.btnIcon" class="formText" id="oIcon" style="width:300px;"/>
				<input type="button" value="新增" onclick="$('#oIcon').val('resource/images/icons/silkicons/add.png')"/>
				<input type="button" value="修改" onclick="$('#oIcon').val('resource/images/icons/silkicons/application_edit.png')"/>
				<input type="button" value="删除" onclick="$('#oIcon').val('resource/images/icons/silkicons/delete.png')"/>
				<input type="button" value="查看" onclick="$('#oIcon').val('resource/images/icons/silkicons/application_view_detail.png')"/>
				<input type="button" value="清空" onclick="$('#oIcon').val('')"/>
			</td>
	    </tr>
	    -->
		<tr id="menuPriority">
			<th>排序：</th>
	        <td><input name="priority" class="formText {digits:true}" value="0" style="width:300px;"/></td>
		</tr>
	    <tr>
	        <th>菜单说明</th>
	        <td><textarea name="description" class="text" style="width:300px;height:56px"></textarea></td>
	    </tr>
	</table>
	
	<div class="buttonArea">
		<input type="button" class="formButton ok" value="确定" onclick="doSubmit()"/>
	    <input type="button" class="formButton cancel" value="取消" onclick="location.href='detail.jhtml?id=${(parentMenu.id)!''}'"/>
	</div>
</form>
</div>
</body>
</html>